import request from '@/utils/request'
/**
 *
 * @returns 获取权限列表
 */
export const getPermissionListAPI = () => request.get('/sys/permission')
/**
 *
 * @param {Object} data 新增一级/二级权限的表单数据
 * @returns 新增一级权限
 */
export const addPermissionListAPI = data => request.post('/sys/permission', data)
/**
 *
 * @param {Object} data 修改二级权限表单数据
 * @returns 修改权限
 */
export const editPermissionAPI = data => request.put(`/sys/permission/${data.id}`, data)
/**
 *
 * @param {Number} id 查看时传递的id
 * @returns 查看权限详情
 */
export const lookPermissionAPI = id => request.get(`/sys/permission/${id}`)
/**
 *
 * @param {Number}} id 传递的id
 * @returns 删除权限
 */
export const delPermissionAPI = id => request.delete(`/sys/permission/${id}`)
